package com.example.lxq.demo.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class VirtualPathConfig implements WebMvcConfigurer{
    /**
     * 虚拟路径配置
     * @param registry
     */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // registry.addResourceHandler("/htmls/**").addResourceLocations("file:/D:\\model space/");
        registry.addResourceHandler("/htmls/**").addResourceLocations("file:/"+SpringObserver.vPath+"/");
        WebMvcConfigurer.super.addResourceHandlers(registry);
    }
}